********************************************************************************************************************************
***   Replication file for:                                                                                                  ***
***   Berbee, P., Braun, S. T. and Franke, R. (2024). Reversing Fortunes of German Regions, 1926-2019. JoEG.			     ***
***   							                                                                                             ***
***   SCRIPT: 	0_data_preparation.do																						 ***	
***   PURPOSE: 	main script for data preparation																			 ***
********************************************************************************************************************************

* Preamble (unnecessary when executing run.do)
run "$reversing/scripts/programs/_config.do"

************
* Code begins
************

*** Scripts for importing raw data from different sources and saving data in Stata format

do "$reversing/scripts/preparation/_x0_regional_classifications.do"  	/* Labor market regions, districts, states */

do "$reversing/scripts/preparation/_x1_preparation_GDP.do"  			/* GDP and population 1957-2019 */

do "$reversing/scripts/preparation/_x2a_preparation_census_1882.do"  	/* Occupation census 1882 */
do "$reversing/scripts/preparation/_x2b_preparation_census_1895.do"  	/* Occupation census 1895 */
do "$reversing/scripts/preparation/_x2c_preparation_census_1907.do"  	/* Manufacturing census 1907 */
do "$reversing/scripts/preparation/_x2d_preparation_census_1939.do"  	/* Occupation census 1939 */
do "$reversing/scripts/preparation/_x2e_preparation_census_1950.do"  	/* Occupation census 1950 */
do "$reversing/scripts/preparation/_x2f_preparation_census_1950_87.do"  /* Population censuses 1950-87 (from GESIS) */
do "$reversing/scripts/preparation/_x2g_preparation_census_1961.do"  	/* Population census 1961 */
do "$reversing/scripts/preparation/_x2h_preparation_census_2011.do"  	/* Educational controls from Volkszählungen */

do "$reversing/scripts/preparation/_x3a_preparation_turnover_1926.do"  	/* Turnover and population 1926 */
do "$reversing/scripts/preparation/_x3b_preparation_turnover_1935.do"   /* Turnover and population 1935 */
do "$reversing/scripts/preparation/_x3c_preparation_turnover_1950.do"  	/* Turnover and population 1950 */

do "$reversing/scripts/preparation/_x4_preparation_spatialcontrols.do" 	/* Spatial/geographical controls */

do "$reversing/scripts/preparation/_x5_preparation_instrument.do"  		/* Instrumental variable and land access */

do "$reversing/scripts/preparation/_x6_preparation_misc.do"  			/* Other variables: Patents 1877-2016, pre-industrial development, 1957 election */

do "$reversing/scripts/preparation/_x99_merge_create_label.do"  		/* Merge data; create, label, and order variables */



*** EOF